using WPFTemplateLib.Mvvm;

namespace WPFPractice.UserControls.DynamicColumnTable
{
	/// <summary>
	/// 动态表格行或列的基类
	/// </summary>
	public abstract class TableRowColBase : ObservableObject
	{
		protected TableRowColBase(RowColType type)
		{
			RowColType = type;
		}

		protected TableRowColBase(RowColType type, string header) : this(type)
		{
			Header = header;
		}

		/// <summary>
		/// 行/列 类型
		/// </summary>
		public RowColType RowColType { get; set; }

		/// <summary>
		/// 标题
		/// </summary>
		public string Header { set; get; }

		private bool _IsSelected;
		/// <summary>
		/// 是否被选中
		/// </summary>
		public bool IsSelected { get => _IsSelected; set => SetProperty(ref _IsSelected, value); }

		private bool _CanSelected = true;
		/// <summary>
		/// 能否选择
		/// </summary>
		public bool CanSelected { get => _CanSelected; set => SetProperty(ref _CanSelected, value); }

		/// <summary>
		/// 可存放相关业务ID
		/// </summary>
		public string Id { get; set; }

		/// <summary>
		/// 索引（需自行设置）
		/// </summary> 
		public int Index { get; set; }

		/// <summary>
		/// 标识
		/// </summary>
		public string Tag { get; set; }

		/// <summary>
		/// 可存放一些数据
		/// </summary>
		public object Data { get; set; }
	}

	public enum RowColType
	{
		Row,
		Column,
	}
}
